import { GetRequest, PostRequest, PutRequest } from '@/utils/request'
import type { Response } from '@/utils/request'
import netconfig from '@/config/netconfig'

/**
 * 通过vib获取家电类别相关信息
 */
export type DeviceModel = {
  type: string
  brand?: string
  catelog: string
  launched: number
  catelog_name: string
  catelog_pic: string
}

export function getCatelogByVib(vib: string): Promise<Response<DeviceModel>> {
  return PostRequest('/api/installguide/v1/pairing/simple/' + vib, {
    hasShowAll: netconfig.isTester,
  })
}
